package com.cn.demo;

import java.util.function.Consumer;
import java.util.function.Supplier;

/**
 * 描述
 *
 * @author wangjf
 * @version 1.0
 * @createDate 2019/11/4 17:08
 * @projectName test
 */
public class LambdaDemo {

    public static String getSupplier(Supplier<String> supplier) {
        return supplier.get();
    }

    public static void getConsumer(String input, Consumer<String> consumer) {
        consumer.accept(input);
    }

    public static void main(String[] args) {


        String string = getSupplier(() -> {
            return "test";
        });
        System.out.println(string);

        String name = "aa";

        getConsumer(name, (s) -> System.out.println(s + "bb"));

    }
}
